home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Itch / work_info / WImage.dcr / 00022_GreetingCherub Parent.ls < prev    next >
Encoding:
Text File  |  1999-03-07  |  950 b   |  48 lines

  1. property sp, pos, speed, state, bannerObj, myWingObj
  2. global worldObj
  3.  
  4. on new me, asp
  5.   me.sp = asp
  6.   puppetSprite(me.sp, 1)
  7.   me.speed = 1
  8.   me.state = #fly
  9.   me.pos = the loc of sprite me.sp
  10.   bannerObj = new(script("Banner Parent"), asp + 1)
  11.   myWingObj = new(script("GreetChbWings Parent"), asp - 1)
  12.   return me
  13. end
  14.  
  15. on CheckState me
  16.   case me.state of
  17.     #fly:
  18.       fly(me)
  19.       fly(myWingObj)
  20.   end case
  21. end
  22.  
  23. on fly me
  24.   if me.pos.locH >= (worldObj.worldRect.right + 200) then
  25.     UpdatePos(me, point(-900, 0))
  26.     DrawtoStage(me)
  27.     put the loc of sprite me.sp
  28.     me.state = #stop
  29.     go("Credits")
  30.   else
  31.     UpdatePos(me, point(me.speed, 0))
  32.     DrawtoStage(me)
  33.   end if
  34. end
  35.  
  36. on UpdatePos me, aPos
  37.   tempPos = me.pos + aPos
  38.   me.pos = tempPos
  39.   UpdatePos(me.bannerObj, aPos)
  40.   UpdatePos(me.myWingObj, aPos)
  41. end
  42.  
  43. on DrawtoStage me
  44.   set the loc of sprite the sp of me to me.pos
  45.   DrawtoStage(me.bannerObj)
  46.   DrawtoStage(me.myWingObj)
  47. end
  48.